<template>
    <Layout class="menu-left">

        <Menu mode="horizontal" @on-select='lowerStep' :active-name="modaleshow">
            <MenuItem :name="1">设备设施风险</MenuItem>
            <MenuItem :name="2">作业流程风险</MenuItem>
            <MenuItem :name="3">人员岗位风险</MenuItem>
            <MenuItem :name="4">环境氛围风险</MenuItem>
        </Menu>

        <equipmentFacilitiesRiskPreset  v-show="modaleshow==1" ref="equipmentFacilitiesRiskPreset"></equipmentFacilitiesRiskPreset>

        <workProcessRiskPreset v-show="modaleshow==2" ref="workProcessRiskPreset"></workProcessRiskPreset>

        <personnelJobRiskPreset v-show="modaleshow==3" ref="personnelJobRiskPreset"></personnelJobRiskPreset>

        <environmentalRiskPreset v-show="modaleshow==4" ref="environmentalRiskPreset"></environmentalRiskPreset>

    </Layout>
</template>
<script>
    import equipmentFacilitiesRiskPreset from './equipmentFacilitiesRiskPreset.vue'
    import workProcessRiskPreset from './workProcessRiskPreset.vue'
    import personnelJobRiskPreset from './personnelJobRiskPreset.vue'
    import environmentalRiskPreset from './environmentalRiskPreset.vue'
    import {Api} from '../../../../api/index.js'
    import {sessionStorage} from '../../../../common/cacheUtils.js';
    export default {
        components: {
            equipmentFacilitiesRiskPreset,
            environmentalRiskPreset,
            workProcessRiskPreset,
            personnelJobRiskPreset
        },
        name: "riskPreset",//风险预置
        data(){
            return{
                form1: {
                    hazardFactor: '',
                    rikRankId: '',
                },
                modaleshow:1,
                riskUnitsAll:[]
            }
        },
        mounted(){
            // this.query()
        },
        methods:{
            lowerStep(name) {
              this.modaleshow=name
                // this.query()
            },
          /*  query() {
                let url = Api.riskUnitsList+'/'+sessionStorage('userId').getObject('userId').orgInfo.orgId
                this.$http.get(url).then((res) => {
                    this.riskUnitsAll = res.data.data;
                }).catch(e => {
                    this.$Message.error("数据获取失败")
                })
            },*/
           /* addInfo(){
                if (this.modaleshow == 1) {
                    this.$refs.equipmentFacilitiesRiskPreset.addInfo()
                }else if (this.modaleshow == 2) {
                    this.$refs.workProcessRiskPreset.addInfo()
                }else if (this.modaleshow == 3) {
                    this.$refs.personnelJobRiskPreset.addInfo()
                }else if (this.modaleshow == 4) {
                    this.$refs.environmentalRiskPreset.addInfo()
                }
            },
            query(){
                if (this.modaleshow == 1) {
                    this.$refs.equipmentFacilitiesRiskPreset.query()
                }else if (this.modaleshow == 2) {
                    this.$refs.workProcessRiskPreset.query()
                }else if (this.modaleshow == 3) {
                    this.$refs.personnelJobRiskPreset.query()
                }else if (this.modaleshow == 4) {
                    this.$refs.environmentalRiskPreset.query()
                }
            },
            reset() {
                this.form1 = {
                    hazardFactor: '',
                    rikRankId: ''
                }
            },*/

        }
    }
</script>


<style scoped>
    @import '../../../../index.css';
</style>
